<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 是否是一个纯函数
    function sum(num1, num2) {
      return num1 + num2
    }

    console.log(sum(20, 30))

    let foo = 10

    function add(num) {
      return foo + num
    }

    add(5)
    foo = 20
    console.log(foo)
    add(10)
    console.log(foo)
  </script>
</body>
</html>